\(\int (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx\) [28]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 140 \[ \int (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx=8 a^4 (A-i B) x-\frac {8 a^4 (i A+B) \log (\cos (c+d x))}{d}-\frac {4 a^4 (A-i B) \tan (c+d x)}{d}+\frac {a (i A+B) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d}+\frac {(i A+B) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d} \]

[Out]

8*a^4*(A-I*B)*x-8*a^4*(I*A+B)*ln(cos(d*x+c))/d-4*a^4*(A-I*B)*tan(d*x+c)/d+1/3*a*(I*A+B)*(a+I*a*tan(d*x+c))^3/d
+1/4*B*(a+I*a*tan(d*x+c))^4/d+(I*A+B)*(a^2+I*a^2*tan(d*x+c))^2/d

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3608, 3559, 3558, 3556} \[ \int (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx=-\frac {4 a^4 (A-i B) \tan (c+d x)}{d}-\frac {8 a^4 (B+i A) \log (\cos (c+d x))}{d}+8 a^4 x (A-i B)+\frac {(B+i A) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\frac {a (B+i A) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d} \]

[In]

Int[(a + I*a*Tan[c + d*x])^4*(A + B*Tan[c + d*x]),x]

[Out]

8*a^4*(A - I*B)*x - (8*a^4*(I*A + B)*Log[Cos[c + d*x]])/d - (4*a^4*(A - I*B)*Tan[c + d*x])/d + (a*(I*A + B)*(a
 + I*a*Tan[c + d*x])^3)/(3*d) + (B*(a + I*a*Tan[c + d*x])^4)/(4*d) + ((I*A + B)*(a^2 + I*a^2*Tan[c + d*x])^2)/
d

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3558

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(a^2 - b^2)*x, x] + (Dist[2*a*b, Int[Tan[c + d
*x], x], x] + Simp[b^2*(Tan[c + d*x]/d), x]) /; FreeQ[{a, b, c, d}, x]

Rule 3559

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((a + b*Tan[c + d*x])^(n - 1)/(d*(n - 1))
), x] + Dist[2*a, Int[(a + b*Tan[c + d*x])^(n - 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && G
tQ[n, 1]

Rule 3608

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*(
(a + b*Tan[e + f*x])^m/(f*m)), x] + Dist[(b*c + a*d)/b, Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[{a, b, c,
d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] &&  !LtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {B (a+i a \tan (c+d x))^4}{4 d}-(-A+i B) \int (a+i a \tan (c+d x))^4 \, dx \\ & = \frac {a (i A+B) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d}+(2 a (A-i B)) \int (a+i a \tan (c+d x))^3 \, dx \\ & = \frac {a (i A+B) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d}+\frac {(i A+B) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\left (4 a^2 (A-i B)\right ) \int (a+i a \tan (c+d x))^2 \, dx \\ & = 8 a^4 (A-i B) x-\frac {4 a^4 (A-i B) \tan (c+d x)}{d}+\frac {a (i A+B) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d}+\frac {(i A+B) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\left (8 a^4 (i A+B)\right ) \int \tan (c+d x) \, dx \\ & = 8 a^4 (A-i B) x-\frac {8 a^4 (i A+B) \log (\cos (c+d x))}{d}-\frac {4 a^4 (A-i B) \tan (c+d x)}{d}+\frac {a (i A+B) (a+i a \tan (c+d x))^3}{3 d}+\frac {B (a+i a \tan (c+d x))^4}{4 d}+\frac {(i A+B) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.02 (sec) , antiderivative size = 86, normalized size of antiderivative = 0.61 \[ \int (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx=\frac {B (a+i a \tan (c+d x))^4+\frac {4}{3} a^4 (i A+B) \left (4+24 \log (i+\tan (c+d x))+21 i \tan (c+d x)-6 \tan ^2(c+d x)-i \tan ^3(c+d x)\right )}{4 d} \]

[In]

Integrate[(a + I*a*Tan[c + d*x])^4*(A + B*Tan[c + d*x]),x]

[Out]

(B*(a + I*a*Tan[c + d*x])^4 + (4*a^4*(I*A + B)*(4 + 24*Log[I + Tan[c + d*x]] + (21*I)*Tan[c + d*x] - 6*Tan[c +
 d*x]^2 - I*Tan[c + d*x]^3))/3)/(4*d)

Maple [A] (verified)

Time = 0.11 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.87

method result size
derivativedivides \(\frac {a^{4} \left (-\frac {4 i B \left (\tan ^{3}\left (d x +c \right )\right )}{3}+\frac {B \left (\tan ^{4}\left (d x +c \right )\right )}{4}-2 i A \left (\tan ^{2}\left (d x +c \right )\right )+\frac {A \left (\tan ^{3}\left (d x +c \right )\right )}{3}+8 i B \tan \left (d x +c \right )-\frac {7 B \left (\tan ^{2}\left (d x +c \right )\right )}{2}-7 A \tan \left (d x +c \right )+\frac {\left (8 i A +8 B \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (-8 i B +8 A \right ) \arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) \(122\)
default \(\frac {a^{4} \left (-\frac {4 i B \left (\tan ^{3}\left (d x +c \right )\right )}{3}+\frac {B \left (\tan ^{4}\left (d x +c \right )\right )}{4}-2 i A \left (\tan ^{2}\left (d x +c \right )\right )+\frac {A \left (\tan ^{3}\left (d x +c \right )\right )}{3}+8 i B \tan \left (d x +c \right )-\frac {7 B \left (\tan ^{2}\left (d x +c \right )\right )}{2}-7 A \tan \left (d x +c \right )+\frac {\left (8 i A +8 B \right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}+\left (-8 i B +8 A \right ) \arctan \left (\tan \left (d x +c \right )\right )\right )}{d}\) \(122\)
norman \(\left (-8 i B \,a^{4}+8 A \,a^{4}\right ) x -\frac {\left (4 i A \,a^{4}+7 B \,a^{4}\right ) \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}-\frac {\left (-8 i B \,a^{4}+7 A \,a^{4}\right ) \tan \left (d x +c \right )}{d}+\frac {\left (-4 i B \,a^{4}+A \,a^{4}\right ) \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}+\frac {B \,a^{4} \left (\tan ^{4}\left (d x +c \right )\right )}{4 d}+\frac {4 \left (i A \,a^{4}+B \,a^{4}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}\) \(142\)
parallelrisch \(\frac {-16 i B \left (\tan ^{3}\left (d x +c \right )\right ) a^{4}+3 B \left (\tan ^{4}\left (d x +c \right )\right ) a^{4}-24 i A \left (\tan ^{2}\left (d x +c \right )\right ) a^{4}+4 A \left (\tan ^{3}\left (d x +c \right )\right ) a^{4}-96 i B x \,a^{4} d +48 i A \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{4}+96 A x \,a^{4} d +96 i B \tan \left (d x +c \right ) a^{4}-42 B \left (\tan ^{2}\left (d x +c \right )\right ) a^{4}-84 A \tan \left (d x +c \right ) a^{4}+48 B \ln \left (1+\tan ^{2}\left (d x +c \right )\right ) a^{4}}{12 d}\) \(156\)
risch \(\frac {16 i a^{4} B c}{d}-\frac {16 a^{4} A c}{d}-\frac {4 a^{4} \left (18 i A \,{\mathrm e}^{6 i \left (d x +c \right )}+30 B \,{\mathrm e}^{6 i \left (d x +c \right )}+45 i A \,{\mathrm e}^{4 i \left (d x +c \right )}+63 B \,{\mathrm e}^{4 i \left (d x +c \right )}+38 i A \,{\mathrm e}^{2 i \left (d x +c \right )}+50 B \,{\mathrm e}^{2 i \left (d x +c \right )}+11 i A +14 B \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}-\frac {8 a^{4} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) B}{d}-\frac {8 i a^{4} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) A}{d}\) \(170\)
parts \(A \,a^{4} x +\frac {\left (-4 i A \,a^{4}-6 B \,a^{4}\right ) \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}\right )}{d}+\frac {\left (-4 i B \,a^{4}+A \,a^{4}\right ) \left (\frac {\left (\tan ^{3}\left (d x +c \right )\right )}{3}-\tan \left (d x +c \right )+\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {\left (4 i A \,a^{4}+B \,a^{4}\right ) \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {\left (4 i B \,a^{4}-6 A \,a^{4}\right ) \left (\tan \left (d x +c \right )-\arctan \left (\tan \left (d x +c \right )\right )\right )}{d}+\frac {B \,a^{4} \left (\frac {\left (\tan ^{4}\left (d x +c \right )\right )}{4}-\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}\right )}{d}\) \(198\)

[In]

int((a+I*a*tan(d*x+c))^4*(A+B*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*a^4*(-4/3*I*B*tan(d*x+c)^3+1/4*B*tan(d*x+c)^4-2*I*A*tan(d*x+c)^2+1/3*A*tan(d*x+c)^3+8*I*B*tan(d*x+c)-7/2*B
*tan(d*x+c)^2-7*A*tan(d*x+c)+1/2*(8*B+8*I*A)*ln(1+tan(d*x+c)^2)+(8*A-8*I*B)*arctan(tan(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 227, normalized size of antiderivative = 1.62 \[ \int (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx=-\frac {4 \, {\left (6 \, {\left (3 i \, A + 5 \, B\right )} a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 9 \, {\left (5 i \, A + 7 \, B\right )} a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, {\left (19 i \, A + 25 \, B\right )} a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (11 i \, A + 14 \, B\right )} a^{4} + 6 \, {\left ({\left (i \, A + B\right )} a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, {\left (i \, A + B\right )} a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, {\left (i \, A + B\right )} a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, {\left (i \, A + B\right )} a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + {\left (i \, A + B\right )} a^{4}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )\right )}}{3 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]

[In]

integrate((a+I*a*tan(d*x+c))^4*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

-4/3*(6*(3*I*A + 5*B)*a^4*e^(6*I*d*x + 6*I*c) + 9*(5*I*A + 7*B)*a^4*e^(4*I*d*x + 4*I*c) + 2*(19*I*A + 25*B)*a^
4*e^(2*I*d*x + 2*I*c) + (11*I*A + 14*B)*a^4 + 6*((I*A + B)*a^4*e^(8*I*d*x + 8*I*c) + 4*(I*A + B)*a^4*e^(6*I*d*
x + 6*I*c) + 6*(I*A + B)*a^4*e^(4*I*d*x + 4*I*c) + 4*(I*A + B)*a^4*e^(2*I*d*x + 2*I*c) + (I*A + B)*a^4)*log(e^
(2*I*d*x + 2*I*c) + 1))/(d*e^(8*I*d*x + 8*I*c) + 4*d*e^(6*I*d*x + 6*I*c) + 6*d*e^(4*I*d*x + 4*I*c) + 4*d*e^(2*
I*d*x + 2*I*c) + d)

Sympy [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 241 vs. \(2 (116) = 232\).

Time = 0.44 (sec) , antiderivative size = 241, normalized size of antiderivative = 1.72 \[ \int (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx=- \frac {8 i a^{4} \left (A - i B\right ) \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {- 44 i A a^{4} - 56 B a^{4} + \left (- 152 i A a^{4} e^{2 i c} - 200 B a^{4} e^{2 i c}\right ) e^{2 i d x} + \left (- 180 i A a^{4} e^{4 i c} - 252 B a^{4} e^{4 i c}\right ) e^{4 i d x} + \left (- 72 i A a^{4} e^{6 i c} - 120 B a^{4} e^{6 i c}\right ) e^{6 i d x}}{3 d e^{8 i c} e^{8 i d x} + 12 d e^{6 i c} e^{6 i d x} + 18 d e^{4 i c} e^{4 i d x} + 12 d e^{2 i c} e^{2 i d x} + 3 d} \]

[In]

integrate((a+I*a*tan(d*x+c))**4*(A+B*tan(d*x+c)),x)

[Out]

-8*I*a**4*(A - I*B)*log(exp(2*I*d*x) + exp(-2*I*c))/d + (-44*I*A*a**4 - 56*B*a**4 + (-152*I*A*a**4*exp(2*I*c)
- 200*B*a**4*exp(2*I*c))*exp(2*I*d*x) + (-180*I*A*a**4*exp(4*I*c) - 252*B*a**4*exp(4*I*c))*exp(4*I*d*x) + (-72
*I*A*a**4*exp(6*I*c) - 120*B*a**4*exp(6*I*c))*exp(6*I*d*x))/(3*d*exp(8*I*c)*exp(8*I*d*x) + 12*d*exp(6*I*c)*exp
(6*I*d*x) + 18*d*exp(4*I*c)*exp(4*I*d*x) + 12*d*exp(2*I*c)*exp(2*I*d*x) + 3*d)

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.81 \[ \int (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx=\frac {3 \, B a^{4} \tan \left (d x + c\right )^{4} + 4 \, {\left (A - 4 i \, B\right )} a^{4} \tan \left (d x + c\right )^{3} - 6 \, {\left (4 i \, A + 7 \, B\right )} a^{4} \tan \left (d x + c\right )^{2} + 96 \, {\left (d x + c\right )} {\left (A - i \, B\right )} a^{4} - 48 \, {\left (-i \, A - B\right )} a^{4} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 12 \, {\left (7 \, A - 8 i \, B\right )} a^{4} \tan \left (d x + c\right )}{12 \, d} \]

[In]

integrate((a+I*a*tan(d*x+c))^4*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/12*(3*B*a^4*tan(d*x + c)^4 + 4*(A - 4*I*B)*a^4*tan(d*x + c)^3 - 6*(4*I*A + 7*B)*a^4*tan(d*x + c)^2 + 96*(d*x
 + c)*(A - I*B)*a^4 - 48*(-I*A - B)*a^4*log(tan(d*x + c)^2 + 1) - 12*(7*A - 8*I*B)*a^4*tan(d*x + c))/d

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 408 vs. \(2 (120) = 240\).

Time = 0.54 (sec) , antiderivative size = 408, normalized size of antiderivative = 2.91 \[ \int (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx=-\frac {4 \, {\left (6 i \, A a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 6 \, B a^{4} e^{\left (8 i \, d x + 8 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 i \, A a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 \, B a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 36 i \, A a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 36 \, B a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 i \, A a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 \, B a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 18 i \, A a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 30 \, B a^{4} e^{\left (6 i \, d x + 6 i \, c\right )} + 45 i \, A a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 63 \, B a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + 38 i \, A a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + 50 \, B a^{4} e^{\left (2 i \, d x + 2 i \, c\right )} + 6 i \, A a^{4} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 6 \, B a^{4} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 11 i \, A a^{4} + 14 \, B a^{4}\right )}}{3 \, {\left (d e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, d e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]

[In]

integrate((a+I*a*tan(d*x+c))^4*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

-4/3*(6*I*A*a^4*e^(8*I*d*x + 8*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) + 6*B*a^4*e^(8*I*d*x + 8*I*c)*log(e^(2*I*d*x
+ 2*I*c) + 1) + 24*I*A*a^4*e^(6*I*d*x + 6*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) + 24*B*a^4*e^(6*I*d*x + 6*I*c)*log
(e^(2*I*d*x + 2*I*c) + 1) + 36*I*A*a^4*e^(4*I*d*x + 4*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) + 36*B*a^4*e^(4*I*d*x
+ 4*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) + 24*I*A*a^4*e^(2*I*d*x + 2*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) + 24*B*a^4
*e^(2*I*d*x + 2*I*c)*log(e^(2*I*d*x + 2*I*c) + 1) + 18*I*A*a^4*e^(6*I*d*x + 6*I*c) + 30*B*a^4*e^(6*I*d*x + 6*I
*c) + 45*I*A*a^4*e^(4*I*d*x + 4*I*c) + 63*B*a^4*e^(4*I*d*x + 4*I*c) + 38*I*A*a^4*e^(2*I*d*x + 2*I*c) + 50*B*a^
4*e^(2*I*d*x + 2*I*c) + 6*I*A*a^4*log(e^(2*I*d*x + 2*I*c) + 1) + 6*B*a^4*log(e^(2*I*d*x + 2*I*c) + 1) + 11*I*A
*a^4 + 14*B*a^4)/(d*e^(8*I*d*x + 8*I*c) + 4*d*e^(6*I*d*x + 6*I*c) + 6*d*e^(4*I*d*x + 4*I*c) + 4*d*e^(2*I*d*x +
 2*I*c) + d)

Mupad [B] (verification not implemented)

Time = 7.21 (sec) , antiderivative size = 181, normalized size of antiderivative = 1.29 \[ \int (a+i a \tan (c+d x))^4 (A+B \tan (c+d x)) \, dx=\frac {B\,a^4\,{\mathrm {tan}\left (c+d\,x\right )}^4}{4\,d}+\frac {\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,\left (8\,B\,a^4+A\,a^4\,8{}\mathrm {i}\right )}{d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (\frac {a^4\,\left (A-B\,1{}\mathrm {i}\right )\,3{}\mathrm {i}}{2}+\frac {B\,a^4}{2}+\frac {a^4\,\left (3\,B+A\,1{}\mathrm {i}\right )}{2}\right )}{d}+\frac {\mathrm {tan}\left (c+d\,x\right )\,\left (-3\,a^4\,\left (A-B\,1{}\mathrm {i}\right )+a^4\,\left (B+A\,3{}\mathrm {i}\right )\,1{}\mathrm {i}+B\,a^4\,1{}\mathrm {i}+a^4\,\left (3\,B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}\right )}{d}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^3\,\left (\frac {B\,a^4\,1{}\mathrm {i}}{3}+\frac {a^4\,\left (3\,B+A\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{3}\right )}{d} \]

[In]

int((A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i)^4,x)

[Out]

(log(tan(c + d*x) + 1i)*(A*a^4*8i + 8*B*a^4))/d - (tan(c + d*x)^3*((B*a^4*1i)/3 + (a^4*(A*1i + 3*B)*1i)/3))/d
- (tan(c + d*x)^2*((a^4*(A - B*1i)*3i)/2 + (B*a^4)/2 + (a^4*(A*1i + 3*B))/2))/d + (tan(c + d*x)*(a^4*(A*3i + B
)*1i - 3*a^4*(A - B*1i) + B*a^4*1i + a^4*(A*1i + 3*B)*1i))/d + (B*a^4*tan(c + d*x)^4)/(4*d)